<?php

/**
 * Projet form base class.
 *
 * @method Projet getObject() Returns the current form's model object
 *
 * @package    kc_report_proto
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseProjetForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'prj_id'                  => new sfWidgetFormInputHidden(),
      'rma_id'                  => new sfWidgetFormInputText(),
      'prj_libelle'             => new sfWidgetFormInputText(),
      'prj_date_debut'          => new sfWidgetFormDateTime(),
      'prj_date_fin'            => new sfWidgetFormDateTime(),
      'prj_date_copil_ancien'   => new sfWidgetFormDateTime(),
      'prj_date_copil_prochain' => new sfWidgetFormDateTime(),
      'prj_commentaire'         => new sfWidgetFormInputText(),
      'prj_charge_total_jh'     => new sfWidgetFormInputText(),
      'prj_charge_cons_jh'      => new sfWidgetFormInputText(),
      'prj_charge_raf_jh'       => new sfWidgetFormInputText(),
      'prj_mantis_id'           => new sfWidgetFormInputText(),
      'prj_filtre_sp_mantis_id' => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'prj_id'                  => new sfValidatorChoice(array('choices' => array($this->getObject()->get('prj_id')), 'empty_value' => $this->getObject()->get('prj_id'), 'required' => false)),
      'rma_id'                  => new sfValidatorInteger(),
      'prj_libelle'             => new sfValidatorString(array('max_length' => 255)),
      'prj_date_debut'          => new sfValidatorDateTime(array('required' => false)),
      'prj_date_fin'            => new sfValidatorDateTime(array('required' => false)),
      'prj_date_copil_ancien'   => new sfValidatorDateTime(array('required' => false)),
      'prj_date_copil_prochain' => new sfValidatorDateTime(array('required' => false)),
      'prj_commentaire'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'prj_charge_total_jh'     => new sfValidatorNumber(array('required' => false)),
      'prj_charge_cons_jh'      => new sfValidatorNumber(array('required' => false)),
      'prj_charge_raf_jh'       => new sfValidatorNumber(array('required' => false)),
      'prj_mantis_id'           => new sfValidatorInteger(array('required' => false)),
      'prj_filtre_sp_mantis_id' => new sfValidatorString(array('max_length' => 128, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('projet[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Projet';
  }

}
